package com.linhngua.code.hibernate.core;

import java.io.Serializable;

import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.Transactional;

@Configuration
public class EntityManager<Key extends Serializable, Entity> {
	
	HibernateDataAccess<Key, Entity>	dataAccess;
	
	
	public EntityManager(HibernateDataAccess<Key, Entity> dataAccess) {

		super();
		this.dataAccess = dataAccess;
	}
	
	@Transactional
	public void save(Entity entity) {

		dataAccess.save(entity);
	}
	
}
